/**

   chunksrv.c
   ==========

   Chunk server entry point

**/


/**

   Includes
   --------

   - stdio.h       : printf
   - stdlib.h      : abort,atoi
   - sys/types.h   : stat
   - sys/stat.h    : stat
   - sys/statvfs.h : statvfs
   - unistd.h      : stat
   - getopt.h      : parameters parsing

**/

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include <getopt.h>


/**

   Function: main
   ---------------

**/

int main(int argc,char* argv[])
{
  int arg;
  int port=0;
  int size=0;
  char* dir=NULL;
  
  while( (arg=getopt(argc,argv,"d:p:s:")) != -1 )
    {
      switch(arg)
	{
	case 'd':
	  {
	    dir = optarg;
	    break;
	  }
	case 'p':
	  {
	    port = atoi(optarg);
	    break;
	  }
	case 's':
	  {
	    size = atoi(optarg);
	    break;
	  }
	default:
	  abort();
	}
    }
  

  /* DEBUG */
  printf("Directory: %s\nSize (GB): %d\nPort: %d\n",
	 dir,
	 size,
	 port);
  
  return 0;
}
